package com.quan.admin.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 系统-菜单
 *
 * @author yhaoquan
 * @email yhaoquan@163.com
 * @date 2020-08-08 14:55:51
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("sys_menu")
public class SysMenu implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * ID
	 */
	@TableId(type = IdType.AUTO)
    private Long id;

	/**
	 * PID
	 */
    private Long pid;

	/**
	 * 名称
	 */
    private String name;

	/**
	 * URL
	 */
    private String url;

	/**
	 * 排序
	 */
    private Integer sort;

	/**
	 * 状态(0:禁用:,1:正常)
	 */
    private Integer status;

	/**
	 * 创建时间
	 */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime ctime;

	/**
	 * 最后更新时间
	 */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime utime;

	/**
	 * 子节点
	 */
	@TableField(exist = false)
	private List<SysMenu> children;

	/**
	 * 菜单对应的权限
	 */
	@TableField(exist = false)
	private List<SysPermission> permission;


}
